package com.jctrip.hotel.source.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author：Haruhi
 * @description: 下单接口
 * @Date：2023/8/30 15:56
 * @Package：com.jctrip.hotel.source.client
 * @Project：hotel-main
 */
@FeignClient(name = "GreenTreeOrderClient" ,url = "${feign.url.greentreeorder}")
@RequestMapping(headers = {"accept=application/xml", "Content-Type=application/xml;charset=UTF-8", "Accept-Encoding=gzip, deflate"})
public interface GreenTreeOrderClient {

    /**
     * 查询酒店房型是否可用（正价下单前校验）
     */
    @PostMapping(value = "RoomAvailability/BookingCheck",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String bookingCheck(@RequestBody MultiValueMap<String, ?> postData);

    /**
     * 查询预定状态（通用）
     */
    @PostMapping(value = "Booking/SearchBooking",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String searchBooking(@RequestBody MultiValueMap<String, ?> postData);

    /**
     * 取消预定（通用）
     */
    @PostMapping(value = "Booking/CancelBooking",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String cancelBooking(@RequestBody MultiValueMap<String, ?> postData);

    /**
     * 酒店预定(正价)
     */
    @PostMapping(value = "Booking/CreateBooking",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String createBooking(@RequestBody MultiValueMap<String, ?> postData);


    /**
     * 查询酒店活动房型房量房价是否可用（活动下单前校验）
     */
    @PostMapping(value = "ActivityRoom/BookingCheck_Activity",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String bookingCheckActivity(@RequestBody MultiValueMap<String, ?> postData);

    /**
     * 酒店预定(活动房型)
     */
    @PostMapping(value = "ActivityRoom/CreateBooking_Activity",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String createBookingActivity(@RequestBody MultiValueMap<String, ?> postData);

    /**
     * 查询酒店协议房型房量房价是否可用（协议下单前校验）
     */
    @PostMapping(value = "Agreement/BookingCheck_Agreement",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String bookingCheckAgreement(@RequestBody MultiValueMap<String, ?> postData);

    /**
     * 酒店预定(协议)
     */
    @PostMapping(value = "Agreement/CreateBooking_Agreement",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String createBookingAgreement(@RequestBody MultiValueMap<String, ?> postData);
}
